home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / applications / wp / fwmacros1.lha / UserMacros / english / EditGroupCoordinates.fw < prev    next >
Encoding:
Text File  |  1994-10-04  |  3.6 KB  |  114 lines

  1. /*
  2. $AUTHOR:  Manuel Lemos (UpperDesign@zeus.ci.ua.pt)
  3. $VER: EditGroupCoordinates 1.00 (3.10.94)
  4.       Description:  ARexx macro for FinalWriter to let coordinates of
  5.                     grouped graphic objects be manually edited.
  6. */
  7.  
  8. options results
  9.  
  10. GraphicTool
  11.  
  12. OBJECTO_GRUPO = 8
  13.  
  14. selecionados = 0
  15. FirstObject SELECTED
  16. do until result = 0
  17.   selecionados = selecionados + 1
  18.   objectid.selecionados = result
  19.   NextObject objectid.selecionados SELECTED
  20. end
  21.  
  22. if selecionados >= 1 then
  23. do
  24.  
  25.   call addlib("rexxreqtools.library", 0, -30, 0)
  26.  
  27.   COORDENADA_OK       = 1
  28.   COORDENADA_PAGINA   = 2
  29.   COORDENADA_ESQUERDA = 3
  30.   COORDENADA_CIMA     = 4
  31.   COORDENADA_LARGURA  = 5
  32.   COORDENADA_ALTURA   = 6
  33.  
  34.   do objecto = 1 to selecionados
  35.     GetObjectType objectid.objecto
  36.     tipo = result
  37.     if tipo = OBJECTO_GRUPO then
  38.       do
  39.         GetObjectCoords objectid.objecto
  40.         coords = RESULT
  41.         PARSE VAR coords pagina esquerda cima largura altura
  42.         do until coordenadas = COORDENADA_OK
  43.           do
  44.             coordenadas = rtezrequest( "Group Coordinates",,
  45.                                "_Ok|_Page|_Left|_Top|_Width|_Height|_Cancel",,
  46.                                "" )
  47.             select
  48.               when coordenadas = COORDENADA_OK then
  49.                 do
  50.                   SetObjectCoords objectid.objecto pagina esquerda cima largura altura
  51.                   redraw
  52.                   break
  53.                 end
  54.   
  55.               when coordenadas = COORDENADA_PAGINA then
  56.                 do
  57.                   nova_pagina = rtgetlong( pagina,,
  58.                                         "Page",,
  59.                                         "Group Coordinates",,
  60.                                         "_Ok|_Cancel")
  61.                   if rtresult = 1 then
  62.                     pagina = nova_pagina
  63.                 end
  64.               when coordenadas = COORDENADA_ESQUERDA then
  65.                 do
  66.                   nova_esquerda = rtgetstring( esquerda,,
  67.                                         "Left",,
  68.                                         "Group Coordinates",,
  69.                                         "_Ok|_Cancel")
  70.                   if rtresult = 1 then
  71.                     esquerda = nova_esquerda
  72.                 end
  73.               when coordenadas = COORDENADA_CIMA then
  74.                 do
  75.                   nova_cima = rtgetstring( cima,,
  76.                                         "Top",,
  77.                                         "Group Coordinates",,
  78.                                         "_Ok|_Cancel")
  79.                   if rtresult = 1 then
  80.                     cima = nova_cima
  81.                 end
  82.               when coordenadas = COORDENADA_ALTURA then
  83.                 do
  84.                   nova_altura = rtgetstring( altura,,
  85.                                         "Height",,
  86.                                         "Group Coordinates",,
  87.                                         "_Ok|_Cancel")
  88.                   if rtresult = 1 then
  89.                     altura = nova_altura
  90.                 end
  91.               when coordenadas = COORDENADA_LARGURA then
  92.                 do
  93.                   nova_largura = rtgetstring( largura,,
  94.                                         "Width",,
  95.                                         "Group Coordinates",,
  96.                                         "_Ok|_Cancel")
  97.                   if rtresult = 1 then
  98.                     largura = nova_largura
  99.                 end
  100.               otherwise
  101.                 break
  102.             end
  103.           end
  104.         end
  105.       end
  106.   end
  107.  
  108.   /* voltar a selecionar todos os objectos selecionados antes */
  109.   do objecto = 1 to selecionados
  110.     SelectObject objectid.objecto MULTIPLE
  111.   end
  112.   redraw
  113. end
  114.